using System;
using System.Data;
using System.ComponentModel;
using System.Reflection;
using System.Collections.Generic;
using DataObject.Helpers;

namespace DataObject.Model
{
	[Serializable]
	public class ServiceProviderDTO : DTOBase
	{
        public ServiceProviderDTO()
        {
            ServiceProviderID = Helper.NewSeqGuid();
        }

        public string Method
        {
            get
            {
                if (ChoiceOption == 0)

                    return String.Format("Package for {0} {1} with price of {2}{4} - Fee for extra {1} is {3}{4}",
                                                     NumInPackage,
                                                     define.Unit[Unit],
                                                     PackagePrice,
                                                     UnitPrice,
                                                     ((CurrencyEnum)Currency).GetStringValue());
                return String.Format("Standard Cost is {0}{1} for {2}", UnitPrice, ((CurrencyEnum)Currency).GetStringValue(), define.Unit[Unit]);
            }
        }

		#region Reference property Members

		private ProviderDTO _provider = new ProviderDTO();
		public ProviderDTO Provider
		{
			get
			{
				return _provider;
			}
			set
			{
				if (_provider != value)
				{
					_provider = value;
				}
			}
		}
		private ServiceDTO _service = new ServiceDTO();
		public ServiceDTO Service
		{
			get
			{
				return _service;
			}
			set
			{
				if (_service != value)
				{
					_service = value;
				}
			}
		}

		#endregion

		#region Collection Members


		#endregion

		#region Property NightFlag

        private bool _nightFlag;

		/// <summary>
        ///  Property NightFlag
		/// <summary>
        public bool NightFlag
		{
			get
			{
                return _nightFlag;
			}

			set
			{
                if (_nightFlag != value)
				{
					this.OnNightFlagChanging(value);
                    _nightFlag = value;
                    this.OnNightFlagChanged();
					OnChanged();
				}
			}
		}

		#endregion

		#region Property ChoiceOption

		private int _choiceOption;

		/// <summary>
		///  Property ChoiceOption
		/// <summary>
		public int ChoiceOption
		{
			get
			{
				return _choiceOption;
			}

			set
			{
				if (_choiceOption != value)
				{
					this.OnChoiceOptionChanging(value);
					_choiceOption = value;
					this.OnChoiceOptionChanged();
					OnChanged();
				}
			}
		}

		#endregion

		#region Property CurrencyPrice

		private int _currency;

		/// <summary>
        ///  Property Currency
		/// <summary>
		public int Currency
		{
			get
			{
                return _currency;
			}

			set
			{
                if (_currency != value)
				{
					this.OnCurrencyChanging(value);
                    _currency = value;
					this.OnCurrencyChanged();
					OnChanged();
				}
			}
		}

		#endregion

		#region Property NumInPackage

		private int _numInPackage;

		/// <summary>
		///  Property NumInPackage
		/// <summary>
		public int NumInPackage
		{
			get
			{
				return _numInPackage;
			}

			set
			{
				if (_numInPackage != value)
				{
					this.OnNumInPackageChanging(value);
					_numInPackage = value;
					this.OnNumInPackageChanged();
					OnChanged();
				}
			}
		}

		#endregion

		#region Property OtherUom

		private string _otherUom;

		/// <summary>
		///  Property OtherUom
		/// <summary>
		public string OtherUom
		{
			get
			{
				return _otherUom;
			}

			set
			{
				if (_otherUom != value)
				{
					this.OnOtherUomChanging(value);
					_otherUom = value;
					this.OnOtherUomChanged();
					OnChanged();
				}
			}
		}

		#endregion

		#region Property PackagePrice

		private decimal _packagePrice;

		/// <summary>
		///  Property PackagePrice
		/// <summary>
		public decimal PackagePrice
		{
			get
			{
				return _packagePrice;
			}

			set
			{
				if (_packagePrice != value)
				{
					this.OnPackagePriceChanging(value);
					_packagePrice = value;
					this.OnPackagePriceChanged();
					OnChanged();
				}
			}
		}

		#endregion

		#region Property ProviderID

		private Guid _providerID;

		/// <summary>
		///  Property ProviderID
		/// <summary>
		public Guid ProviderID
		{
			get
			{
				return _providerID;
			}

			set
			{
				if (_providerID != value)
				{
					this.OnProviderIDChanging(value);
					_providerID = value;
					this.OnProviderIDChanged();
					OnChanged();
				}
			}
		}

		#endregion

		#region Property UnitPrice

		private decimal _unitPrice;

		/// <summary>
        ///  Property UnitPrice
		/// <summary>
        public decimal UnitPrice
		{
			get
			{
                return _unitPrice;
			}

			set
			{
                if (_unitPrice != value)
				{
					this.OnUnitPriceChanging(value);
                    _unitPrice = value;
					this.OnUnitPriceChanged();
					OnChanged();
				}
			}
		}

		#endregion

        #region Property Unit

        private int _unit;

        /// <summary>
        ///  Property Unit
        /// <summary>
        public int Unit
        {
            get
            {
                return _unit;
            }

            set
            {
                if (_unit != value)
                {
                    this.OnUnitChanging(value);
                    _unit = value;
                    this.OnUnitChanged();
                    OnChanged();
                }
            }
        }

        #endregion

		#region Property ServiceID

		private Guid _serviceID;

		/// <summary>
		///  Property ServiceID
		/// <summary>
		public Guid ServiceID
		{
			get
			{
				return _serviceID;
			}

			set
			{
				if (_serviceID != value)
				{
					this.OnServiceIDChanging(value);
					_serviceID = value;
					this.OnServiceIDChanged();
					OnChanged();
				}
			}
		}

		#endregion

		#region Property ServiceProviderID

		private Guid _serviceProviderID;

		/// <summary>
		///  Property ServiceProviderID
		/// <summary>
		public Guid ServiceProviderID
		{
			get
			{
				return _serviceProviderID;
			}

			set
			{
				if (_serviceProviderID != value)
				{
					this.OnServiceProviderIDChanging(value);
					_serviceProviderID = value;
					this.OnServiceProviderIDChanged();
					OnChanged();
				}
			}
		}

		#endregion

		#region Extensibility Method Declarations

        protected virtual void OnNightFlagChanging(bool nightFlag) { }
        protected virtual void OnNightFlagChanged() { }
		protected virtual void OnChoiceOptionChanging(int choiceOption) { }
		protected virtual void OnChoiceOptionChanged() { }
		protected virtual void OnCurrencyChanging(int currency) { }
		protected virtual void OnCurrencyChanged() { }
		protected virtual void OnNumInPackageChanging(int numInPackage) { }
		protected virtual void OnNumInPackageChanged() { }
		protected virtual void OnOtherUomChanging(string otherUom) { }
		protected virtual void OnOtherUomChanged() { }
		protected virtual void OnPackagePriceChanging(decimal packagePrice) { }
		protected virtual void OnPackagePriceChanged() { }
		protected virtual void OnProviderIDChanging(Guid providerID) { }
		protected virtual void OnProviderIDChanged() { }
		protected virtual void OnUnitPriceChanging(decimal unitPrice) { }
		protected virtual void OnUnitPriceChanged() { }
        protected virtual void OnUnitChanging(int unit) { }
        protected virtual void OnUnitChanged() { }
		protected virtual void OnServiceIDChanging(Guid serviceID) { }
		protected virtual void OnServiceIDChanged() { }
		protected virtual void OnServiceProviderIDChanging(Guid serviceProviderID) { }
		protected virtual void OnServiceProviderIDChanged() { }

		#endregion

	}
}
